package com.lqs.blog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lqs.blog.dos.Archives;
import com.lqs.blog.pojo.Article;;
import com.lqs.blog.vo.Result;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface ArticleMapper extends BaseMapper<Article> {

    List<Article> getArticlesByHot(int limit);

    List<Article> getArticlesByDate(int limit);

    List<Archives> getArchives();

    /**
     * 通过标签查找文章
     * @param tagId
     */
    List<Article> getArticlesByTagId(Long tagId);

    IPage<Article> listArticle(Page<Article> page, Long tagId, Long categoryId, String year, String month);
}
